Skip to content

refactor: Rename algorithm-selection arguments to algorithm and measure selection to measure - #2951

Open
schochastics wants to merge 22 commits into
claude/issue-2788-subagents-faw1t1-13from
claude/issue-2788-subagents-faw1t1-14
Open

schochastics wants to merge 22 commits into
claude/issue-2788-subagents-faw1t1-13from
claude/issue-2788-subagents-faw1t1-14

Conversation

@schochastics

Copy link
Copy Markdown
Contributor

Closes #2932. Part of #2788 (PR 14 of the stack, on top of #2950).

This implements the two-word proposal from #2932 (#2932 (comment)): algorithm for how something is computed, measure for what is computed.

What this does

→ algorithm:

  • method in the isomorphism family: isomorphic(), subgraph_isomorphic(), count_isomorphisms(), count_subgraph_isomorphisms(), isomorphisms(), subgraph_isomorphisms() (the aliases is_isomorphic_to() and is_subgraph_isomorphic_to() follow)
  • method in sample_tree(), sample_degseq(), realize_degseq(), realize_bipartite_degseq(), merge_coords()
  • impl in induced_subgraph()
  • implementation in cluster_spinglass() and fit_power_law()
  • heuristic in greedy_vertex_coloring()

→ measure:

  • method in compare() (generic and its communities/membership/default methods) and similarity()

Unchanged by design: layout_with_fr(grid) (an acceleration switch) and make_clusters(algorithm) (a free-text label read back by algorithm()). With this PR, no live exported function has a method argument any more.

How

  • Registry renames for tail arguments (sample_tree(), sample_degseq(), realize_degseq(), merge_coords(), induced_subgraph(), cluster_spinglass(), greedy_vertex_coloring(), similarity()): legacy names are recovered under the standard single soft-deprecation.
  • Head arguments in the isomorphism functions and fit_power_law(), plus realize_bipartite_degseq() and compare(), which have no registry entry: positional calls are unchanged and silent, and named legacy calls are caught by a trailing method/implementation = deprecated() sentinel. For compare() the sentinel and bridge live in the S3 methods, which must share the generic's formals, because a value reassigned in the generic does not reach the method.
  • The isomorphism functions still forward ... to the per-algorithm backends. An abbreviated meth = used to partial-match the head formal and now lands in ....
  • Internal live callers use the new names (component_wise() → merge_coords()). The sample_degseq() messages for retired values ("simple", …) now say algorithm = . Deprecated wrappers (graph.isomorphic(), similarity.jaccard(), degree.sequence.game(), …) are untouched; only their "please use similarity() with …" hints now name measure.

Tests

There are expect_legacy_arg() checks for every renamed function, including the spec twins tree()/degseq(), a positional call, and the conflict error for a function that uses a sentinel.

The #2788 stack

Each PR is based on the previous one and merges in this order:

  1. refactor: Rename algo to algorithm in page_rank(), feedback_arc_set() and feedback_vertex_set() #2859: algo → algorithm
  2. refactor: Rename nodes to n in generators and centr_*_tmax() #2860: nodes → n (vertex counts)
  3. refactor: snake_case weights arguments in clique functions and cluster_infomap() #2861: weights arguments
  4. refactor: Rename normalization flags to normalized #2862: normalization flags → normalized
  5. refactor: Purge legacy alias formals via the migration registry #2863: hand-rolled alias formals into the registry
  6. refactor: Rename vertex-selector arguments to vertices and vertex #2864: selectors → vertices/vertex
  7. refactor: Rename edge-selector arguments to edges #2943: edge selectors → edges
  8. refactor: Rename index to vertices/edges in the attribute accessors #2944: attribute accessors: index → vertices/edges
  9. refactor: Rename iteration arguments to n_iter/max_iter #2945: iterations → n_iter/max_iter
  10. refactor: snake_case the dotted arguments of the graph generators and degree-sequence functions #2946: snake_case: generators and degree sequences
  11. refactor: snake_case the dotted arguments of the layout functions #2947: snake_case: layouts
  12. refactor: snake_case the dotted arguments of the community, HRG, motif and graphlet functions #2948: snake_case: community, HRG, motifs, graphlets (Mu → mu)
  13. refactor: snake_case the dotted arguments of the structural and conversion functions #2950: snake_case: structural and conversion functions
  14. this PR: algorithm family → algorithm/measure (Algorithm-selection argument names: census of method/algorithm/algo/impl/implementation #2932)

🤖 Generated with Claude Code

krlmlr and others added 4 commits October 15, 2026 19:32
…patch/` (#2934)

Co-authored-by: Claude <noreply@anthropic.com>
…r's series loop does (#2935)

Co-authored-by: Claude <noreply@anthropic.com>
…sure selection to `measure`

`method` (isomorphism functions, `sample_tree()`, `sample_degseq()`,
`realize_degseq()`, `realize_bipartite_degseq()`, `merge_coords()`),
`impl` (`induced_subgraph()`), `implementation` (`cluster_spinglass()`,
`fit_power_law()`) and `heuristic` (`greedy_vertex_coloring()`) become `algorithm`;
`method` in `compare()` and `similarity()` becomes `measure`.
Legacy names are recovered with a soft-deprecation.

Closes #2932. Part of #2788.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

This is how benchmark results would change (along with a 95% confidence interval in relative change) if 809e79f is merged into claude/issue-2788-subagents-faw1t1-13:

  • ✔️E_named: 124ms -> 124ms [-1.9%, +1.16%]
  • ✔️V_named: 265ms -> 261ms [-4.03%, +0.9%]
  • ✔️all_simple_paths_named: 93.7ms -> 93.1ms [-1.8%, +0.56%]
  • ✔️as_adjacency_matrix: 127ms -> 127ms [-1.24%, +0.26%]
  • ✔️as_biadjacency_matrix: 142ms -> 143ms [-0.9%, +2.02%]
  • ✔️as_data_frame_both: 150ms -> 149ms [-4.52%, +2.85%]
  • ✔️as_long_data_frame: 123ms -> 119ms [-8.77%, +1.73%]
  • ✔️ego_order2_named: 109ms -> 109ms [-1.71%, +1.47%]
  • ✔️es_attr_assign: 135ms -> 139ms [-1.94%, +7%]
  • ✔️es_attr_filter: 139ms -> 139ms [-1.44%, +0.56%]
  • ✔️graph_from_adjacency_matrix: 165ms -> 162ms [-4.38%, +1.28%]
  • ✔️graph_from_data_frame: 162ms -> 160ms [-6.18%, +3.44%]
  • ✔️head_of_named: 109ms -> 111ms [-1.6%, +5.76%]
  • ✔️incident_edges: 121ms -> 120ms [-2.01%, +1.71%]
  • ✔️max_cliques_named: 18.1ms -> 18ms [-2.31%, +1.26%]
  • ✔️neighbors_by_name: 157ms -> 154ms [-5.82%, +2.28%]
  • ✔️union_named: 146ms -> 145ms [-1.11%, +0.74%]
  • ✔️vs_attr_filter: 172ms -> 175ms [-0.95%, +4.8%]
  • ✔️vs_by_name: 147ms -> 148ms [-0.14%, +1.69%]
    Further explanation regarding interpretation and methodology can be found in the documentation.

github-actions Bot and others added 11 commits October 16, 2026 00:17
Co-authored-by: krlmlr <krlmlr@users.noreply.github.com>
…ing's setup (#2949)

Co-authored-by: Claude <noreply@anthropic.com>
…edit is vendored (#2956)

Co-authored-by: Claude <noreply@anthropic.com>
… them (#2957)

Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: krlmlr <krlmlr@users.noreply.github.com>
…s fixes in front of the vendor commits (#2959)

Co-authored-by: Claude <noreply@anthropic.com>
…-no-push-dev` (#2961)

Co-authored-by: Claude <noreply@anthropic.com>
… upstream function (#2966)

Co-authored-by: Claude <noreply@anthropic.com>
…s-land.sh --review --series` (#2970)

Co-authored-by: Claude <noreply@anthropic.com>
krlmlr and others added 4 commits October 18, 2026 11:12
…n the tree (#2968)

Co-authored-by: Claude <noreply@anthropic.com>
…ync (#2958)

Co-authored-by: Claude <noreply@anthropic.com>
… fold applied (#2965)

Co-authored-by: Claude <noreply@anthropic.com>
@krlmlr
krlmlr added this pull request to stack #2872 October 18, 2026 09:34
schochastics and others added 3 commits October 18, 2026 11:35
…d input

`igraph_match_arg()` eagerly computed `rlang::caller_arg()` and went
through `rlang::arg_match()` on every call, costing ~19 us even when the
value is valid. It now returns early for the two cases `arg_match()`
accepts (the untouched default, or a single exact match) and only pays
for the error machinery when it has to report one.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants